package com.zh.mediaservice.controller.User;



import com.zh.mediacommon.context.BaseContext;
import com.zh.mediacommon.result.Result;
import com.zh.mediapojo.vo.ReserveOrderVO;
import com.zh.mediaservice.service.OrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
@RestController
@RequestMapping("/order")
@RequiredArgsConstructor
public class OrderController {
    private final OrderService orderService;
    @GetMapping("/userOrder")
    public Result< List<ReserveOrderVO> > getUserOrder(){
        Long userId = BaseContext.getCurrentId();
        List<ReserveOrderVO> list = orderService.getUserOrder(userId);
        return Result.success(list);
    }
}
